package com.fengye.algorithms.leecode;

/**
 * @Author fengye
 * @Date 2023/4/12 17:51
 **/
public class FindTheDifference389 {
    public char findTheDifference(String s, String t) {
        if(s.length() == 0) {
            return t.charAt(0);
        }

        char r = s.charAt(0);
        for(int i=1;i<s.length();i++) {
            r ^= s.charAt(i);
        }

        for(int i=0;i<t.length(); i++){
            r ^= t.charAt(i);
        }

        return r;
    }
}
